import React, {Component} from 'react';
import {connect} from 'react-redux';
import Top from '../../component/top/top';
import FootCon from '../../component/footCon/footCon';
import {setRouterName} from '../../store/public/action';
import ListNav from './listNav/listNav';



class ListPage extends Component {

    componentWillMount() {
        this.props.setRouterName(this.props.location.pathname, this.props.history);
    }

    render() {
        return (
            <div className='listPage'>
                <Top></Top>
                <ListNav searchkeyword={this.props.location.query ? this.props.location.query.searchkeyword : null}></ListNav>
                <FootCon></FootCon>
            </div>
        )
    }

}

const mapStateToProps = (state) => {
    return {
        state: state
    }
}

const mapDispatchToProps = {
    setRouterName: setRouterName,
}
export default connect(mapStateToProps, mapDispatchToProps)(ListPage)